package com.bioroadlab.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * KeywordCategory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "keyword_category", catalog = "bioroadlab")
public class KeywordCategory implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private String name;
	private String englishName;
	private Set<KeywordSubcategory> keywordSubcategories = new HashSet<KeywordSubcategory>(
			0);

	// Property accessors
	@TableGenerator(table = "id_generator", name = "generator", pkColumnName = "name", pkColumnValue = "KeywordCategory", valueColumnName = "id", initialValue = 1, allocationSize = 1)
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "english_name", length = 50)
	public String getEnglishName() {
		return this.englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "keywordCategory")
	public Set<KeywordSubcategory> getKeywordSubcategories() {
		return this.keywordSubcategories;
	}

	public void setKeywordSubcategories(
			Set<KeywordSubcategory> keywordSubcategories) {
		this.keywordSubcategories = keywordSubcategories;
	}

}